
const INITIAL_STATE = {
    num: 0,
    data:{}
}

export default function counter(state = INITIAL_STATE, action) {
    switch (action.type) {
        case 'ADD':
            return {
                ...state,
                data: action.payLoad
            }
        case 'MINUS':
            return {
                ...state,
                num: state.num - 1
            }
        default:
            return state
    }
}